/*
# pymoz, Python extension for the Mozilla Toolkit
# Copyright (C) 2012 Malek Hadj-Ali
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


#ifndef pyWrappers_h_
#define pyWrappers_h_


#include "pyRuntime.h"


/* PyJSObject */

JSObject *
PyJSObject_GetPrivate(PyObject *pyobj);

bool
PyJSObject_InitTypes();

bool
PyJSObject_Check(PyObject *pyobj);

PyObject *
PyJSObject_NewOrUsed(JSContext *cx, JSObject *jsobj);


/* JSPyObject */

JSObject *
JSPyObject_InitPrototype(JSContext *cx, JSObject *glob);

bool
JSPyObject_Check(JSObject *jsobj);

JSObject *
JSPyObject_NewOrUsed(JSContext *cx, PyObject *pyobj);


/* strings mgt */

PyObject *
JSString_Decode(JSContext *cx, JSString *string);


/* conversion utils */

PyObject *
PyObject_FromJSVal(JSContext *cx, jsval val);

jsval
PyObject_AsJSVal(JSContext *cx, PyObject *pyobj);


#endif // pyWrappers_h_
